package daily.may0527;

import java.util.stream.Stream;

public class StreamSkipLimitTest {
    public static void main(String[] args) {
        String[] stringsArray = {"喜羊羊", "沸羊羊", "美羊羊", "懒羊羊", "暖羊羊", "灰太狼", "小灰灰"};
        Stream<String> stringStream = Stream.of(stringsArray);
        stringStream.skip(3)//跳过前三个元素
                .limit(3)//取前三个元素
                .forEach(s -> System.out.print(s + " "));//懒羊羊 暖羊羊 灰太狼
    }
}
